Skip to content

Conversation

@pimyn-girgis
Copy link
Collaborator

If the series author provided a base-commit, use it. If applying the series against the base-commit fails, fall back to the default bisection method.


Before sending a pull request, please review Contribution Guidelines:
https://github.com/google/syzkaller/blob/master/docs/contributing.md


If the series author provided a base-commit, use it. If applying the series against the base-commit fails, fall back to
the default bisection method.
@pimyn-girgis pimyn-girgis requested a review from a-nogikh January 8, 2026 12:38
continue
}
if series.BaseCommitHint == "" { // Usually base-commit is in patch 0 or 1. Check them all to be safe.
regex := regexp.MustCompile(`(?m)^base-commit:\s*([0-9a-fA-F]{40})$`)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We shouldn't compile the regexp for each message. Ideally it should be done once outside of the function, see the majority of other regexp.MustCompile cases.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd also move this extraction to pkg/email.

if series.BaseCommitHint == "" { // Usually base-commit is in patch 0 or 1. Check them all to be safe.
regex := regexp.MustCompile(`(?m)^base-commit:\s*([0-9a-fA-F]{40})$`)
matches := regex.FindStringSubmatch(email.Body)
if len(matches) >= 2 {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can just check for nil.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wanted to avoid an unnecessary crash if the author wrote the tag and forgot the hash. But I just realized it wouldn't match in that case! Will update.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be tested.

SubjectTags []string `json:"subject_tags"`
PublishedAt time.Time `json:"published_at"`
Patches []SeriesPatch `json:"patches"`
BaseCommitHint string `json:"base_commit"`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: let's keep json name similar to the field name.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please rebase it on top of the current master.


// First try to use hints from the series description.
if series.BaseCommitHint != "" {
for _, tree := range trees {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that we should be able to determine the tree from the commit:

  • Given a commit, we can query the branches that have it.
  • Branches are prefixed by tree names (that's the way syz-cluster pulls them).

You can use #6553 as reference here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants